import Swal from 'sweetalert2'
export default {
  install: (Vue) => {
    // sweetalert2 的设置默认配置的方法
    // 添加全局方法

    /* Vue.successInfo = (Swal) => {
      this.fire({
        icon: 'success',
        showConfirmButton: false,
        timer: 1500,
        text: ''
      })
    } */
    // 添加实例方法
    Vue.prototype.$successInfo = (text) => {
      Swal.fire({
        icon: 'success',
        showConfirmButton: false,
        timer: 1500,
        text: text
      })
    }
    Vue.prototype.$errorInfo = (text) => {
      Swal.fire({
        icon: 'error',
        showConfirmButton: false,
        timer: 1500,
        text: text
      })
    }
  }
}
